<template>
  <view class="page">
    <view class="title">
      <view class="top">
        <view class="top-item">卡号</view>
        <view class="top-items">{{ recordLoginText }}</view>
      </view>
      <view class="yuer"> ￥{{ simInfo.depositPrice }}</view>
      <view class="smallyue">合约余额</view>
      <view class="bot">
        <view class="bot-left">
          <view>自动退费时间</view>
          <view>{{ simInfo.depositTimeFormat }}</view>
        </view>
      </view>
    </view>
    <br/>
    <view class="u-form">
      <view class="name">温馨提示</view>
      <view class="tip1" style="margin-top:30upx;">1：畅享流量尊享版(39.9元档)促销产品是以畅享流量尊享版(39.9元档)为主体产品，需办理12个月合约产品畅享流量尊享版(39.9元档)-12个月合约，合约优惠包含300GB全国通用流量和每月20元套餐月费减免。下载《小象通信》APP激活后可再送20G流量活动。畅享流量尊享版(39.9元档)新入网用户免收首月套餐费激活当日起至有效期30天)，套餐内全国通用流量全量提供，该资费有效期365天，合约到期后自动退回。</view>
      <view class="tip1">2：畅享流量尊享版(39.9元档)套餐内包含300GB全国通用流量月包（30天有效期），全国通用流量范围包括中国移动精品APP及阿里系、百度系、抖音系、网易游戏、腾讯系、芒果TV、快手、喜马拉雅、新浪微博、VIVO等超过100款第三方热门APP。具体支持全国通用流量的APP清单随中国移动业务合作情况或将发生变动，以订购页面具体内容为准。</view>
      <view class="tip1">3：激活时连带办理合约活动畅享流量尊享版(39.9元档)-12个月合约，办理当月立即生效，合约期12个月，合约期内每月送20GB通用流量，流量不可结转、不可共享、不可转赠，另合约期内从次月起每月优惠20元套餐费用，合约到期后自动失效。合约期12个月内需使用畅享流量尊享版(39.9元档)，提前取消合约或更改套餐后，将无法享受相关活动优惠。提前退出合约可前往联系人工客服在线办理。</view>
      <view class="tip1">4：畅享流量尊享版(39.9元档)-12个月合约活动额外还可享受300G通用流量*12个月的加赠，流量不可结转、不可共享、不可转赠，激活即得，当月赠送流量月底清零。提前取消合约或更改套餐后系统会自动为您退订300GB通用流量包，流量包预计在激活后24小时之内到账，请保证号码状态正常，保证流量包顺利加赠。</view>
    </view>
    <br/>
    <br/>
    <u-button type="primary" shape="circle"  block color="#397EF5" @click="toKefu()" class="footer-btn">联系客服</u-button>
  </view>
</template>
<script>
export default {
  data() {
    return {
      simInfo: {},
      recordLoginText:uni.getStorageSync('virtualNo'),
      iccid: uni.getStorageSync('iccid'),
    }
  },
  created() {
    this.getInfo();
  },
  methods: {
    toKefu(){
		this.$api.kefuUrl({iccid:uni.getStorageSync('iccid') || ''}).then(res=>{
			let urls=res.data;
			console.log("当前客服链接为"+urls);
			//#ifdef H5
			window.location.href = urls
			//#endif
			//#ifdef APP-PLUS
			uni.navigateTo({
				url:"/pages/index/webview?url=" + urls
			})
			//#endif
      	
		})
    },
    getInfo() {
		this.$api.userInfo({iccid:this.iccid}).then(res=>{
			if (res.code === '200') {
			  this.simInfo = res.data
			} else {
			  uni.showToast({
			  	title: res.message,
			  	icon: 'none'
			  })
			}
		})
    },


  }
}
</script>

<style lang="less" scoped>
.page {
  padding: 0 13px;
  background: linear-gradient(180deg, #3980F9 0%, rgba(244, 246, 250, 1) 240px);
  padding-top: 21px;
  position: relative;
  .u-form {
    width: calc(90% - 14px);
    padding: 25px 14px;
    margin: 23px auto;
    background: #fff;
    border-radius: 10px;

    .name {
      height: 20px;
      font-size: 14px;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #28292D;
      line-height: 20px;
    }

    .tip {
      font-size: 14px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #63666D;
      margin-top: 9px;
      margin-bottom: 20px;
    }

    img {
      width: 358px;
      height: 118px;
    }

    .u-input {
      margin-top: 49px;
      border-bottom: 1px solid #F3F3F3;
    }

    .tip1 {
      font-size: 14px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #63666D;
      text-indent: 28px;
      margin: 10px 0;
      line-height: 20px;
    }
  }

  .title {
    width: 350px;
    height: 238px;
    background: #FFFFFF;
    border-radius: 10px;
    margin: 0 auto;
    position: relative;


    .top {
      display: flex;
      height: 57px;
      padding-left: 11px;
      align-items: center;
      background: linear-gradient(180deg, #B1CEFF 0%, #FFFFFF 100%);
      border-radius: 10px 10px 0px 0px;

      .top-item {
        font-size: 12px;
        font-family: HarmonyOS_Sans_SC;
        color: #FFFFFF;
        text-align: center;
        line-height: 17px;
        width: 62px;
        background: url('../../static/images/icon12.png') no-repeat center;
        background-size: 100% 100%;
      }

      .top-items {
        font-size: 16px;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #28292D;
        line-height: 22px;
        padding-left: 10px;
      }
    }

    .yuer {
      height: 50px;
      font-size: 36px;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #28292D;
      text-align: center;
      line-height: 50px;
      margin-top: 36px;
    }

    .smallyue {
      text-align: center;
      height: 20px;
      font-size: 14px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #999999;
      line-height: 20px;
    }

    .cz {
      width: 88px;
      height: 31px;
      background: url('../../static/images/icon13.png') no-repeat center;
      background-size: 100% 100%;
      position: absolute;
      right: 0;
      top: 40%;
      text-align: center;
      line-height: 30px;
      color: #fff;
    }

    .bot {
      width: 88%;
      margin: 27px auto 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-top: 1px solid #F3F3F3;
      padding-top: 14px;
      .bot-left{
        display: flex;
        justify-content: space-between;
        align-items: center;
		font-size:12px;
        width: 100%;
      }
      .bot-right {
        color: #397FF9;
      }
    }
  }

  .img {
    width: 96%;
    height: 90px;
    margin: 20px auto;
    display: block;
  }
}
.footer-btn{
  position: fixed;
  bottom:20px;
  left: 0;
  right: 0;
  margin: auto;
  width:90%;
}
</style>